⬅ Back

BASIC JAVASCRIPT TERMINOLOGY

This complete note explains the most important beginner terms in JavaScript in simple language.

The goal is not only to memorize words, but also to understand how they work in real code.

1. What is programming?

Programming is the process of writing instructions for a computer.

There are many programming languages in the world, for example:

Programming languages are not like human languages in every way, but they do have some similarities.

Human languages have:

Programming languages also have:

In human language, syntax explains how words are put together correctly.

In programming, syntax explains how code must be written correctly.

For example, syntax tells us:

Syntax is very important. Even a small mistake can stop the program from running.

2. What is code?

Code is a set of instructions that a computer can understand and execute.

A programmer writes code to tell the computer what to do.

Examples of things code can do:

Every programming language has its own rules. A piece of code that works in Python may not work in JavaScript.

3. What is source code?

Source code is the text of a program written by a developer in a programming language.

Example of source code in JavaScript:

console.log("Hello");

This is readable for people who know JavaScript, but the computer does not work with source code directly in the same way humans read it.

Before the machine can execute it, the code must be processed.

This is done by:

These are special programs that convert or read source code and make it understandable to the computer.

Source code should do two things:

  1. solve the problem correctly
  2. stay understandable for the developer or for another person who will edit it later

Good code is not only correct. Good code is also readable.

4. Programming is also logic and problem solving

Programming is not only about typing code.

A big part of programming is:

Experienced developers often think in terms of algorithms.

5. What is an algorithm?

An algorithm is a sequence of steps used to reach a goal.

We use algorithms in everyday life too.

Example: making tea

  1. Boil water
  2. Measure the tea
  3. Put the tea into a container
  4. Pour in the hot water
  5. Wait 5 minutes

This is an algorithm because it has a clear order of steps.

The same idea is used in programming.

When creating a program, the general algorithm is usually:

  1. break the task into smaller parts
  2. decide the correct order of actions
  3. use the right tools to solve each part

Diagram 1. From problem to program

1. Problem
   ↓
2. Break into small tasks
   ↓
3. Create an algorithm
   ↓
4. Write code
   ↓
5. Run the code
   ↓
6. Get the result

6. What is JavaScript?

JavaScript is a high-level programming language supported by all modern web browsers.

It is one of the main languages of web development.

Important: JavaScript and Java are not the same language. They are completely different programming languages.

7. What JavaScript is used for

In front-end development, JavaScript works together with:

JavaScript can do many things on a webpage, for example:

Important note

When JavaScript runs in the browser, it does not have full access to the computer's file system or operating system. This restriction exists for security reasons.

8. JavaScript is not only for the browser

Today JavaScript can be used in many areas:

So JavaScript is a very important language for full stack development.

Diagram 2. Where JavaScript can be used

1. Browser → front-end
2. Node.js → backend
3. React Native → mobile apps
4. Electron → desktop apps
5. Frameworks → full web applications

9. What is a statement?

A statement is a complete instruction written in code.

You can think of a statement like a sentence in human language.

Example:

a = b * 2;

This is one statement.

In JavaScript, statements often end with a semicolon:

;

The semicolon is similar to a period at the end of a sentence.

In the example:

a = b * 2;

10. What is a variable?

A variable is a named place where data is stored.

A variable has:

For example, if b is 10, then:

a = b * 2;

means:

So if:

b = 10;

then after this statement:

a = b * 2;

the value of a becomes:

20

Diagram 3. How a = b * 2; works

1. Find the value of b
   b = 10

2. Calculate b * 2
   10 * 2 = 20

3. Save the result in a
   a = 20

11. What is an operator?

An operator is a symbol that performs an action.

Examples:

In this code:

a = b * 2;

12. What is an expression?

An expression is a part of code that produces a value.

Expressions can be:

Example:

a = b * 2;

This statement contains several expressions.

Expressions inside it

  1. 2 → a literal value expression
  2. b → a variable expression
  3. a → a variable expression
  4. b * 2 → a multiplication expression
  5. a = b * 2 → an assignment expression

The most important idea is this:

A statement is a full instruction. An expression is a smaller part inside the statement.

13. What is a literal?

A literal is a value written directly in code.

It is called "literal" because the value is written exactly as it is, not taken from a variable.

Numeric literal

10

This is a number written directly in code.

String literal

"JavaScript is awesome!"

This is a string written directly in code.

Literals are used when we want to write a specific value directly.

14. Types of literals in this note

1. Numeric literal

25

2. String literal

"Hello"

A string is text inside quotation marks.

Diagram 4. Variable vs literal

1. Literal
   "Hello"
   10

2. Variable
   name that stores a value

Example:
let age = 25;

age   → variable
25    → literal

15. Connecting JavaScript to HTML

To use JavaScript on a webpage, we connect it with the <script> tag.

There are two common ways:

  1. embedded script
  2. external script

16. Embedded script

An embedded script means the JavaScript code is written directly inside the HTML file.

Example:

<!DOCTYPE html>
<html>
<head>
    <title>My HTML page</title>
    <script>
        console.log("Hello, world");
    </script>
</head>
<body>
</body>
</html>

Here, the JavaScript code is inside the <script> tag.

When this is useful

Embedded scripts are okay for:

But usually not the best choice for big projects

In real projects, large scripts inside HTML can make code harder to read and maintain.

17. External script

An external script means the JavaScript code is written in a separate file with the .js extension.

Example HTML:

<!DOCTYPE html>
<html>
<head>
    <title>My HTML page</title>
    <script src="my-script.js" defer></script>
</head>
<body>
</body>
</html>

Example JavaScript file my-script.js:

console.log("Hello from external file");

Here:

18. What does defer do?

The defer attribute tells the browser:

This is useful because it helps the page load more smoothly.

Without defer, JavaScript may run too early.

Example

If JavaScript tries to work with an HTML element before that element exists on the page, there can be an error.

So defer is often a very good idea.

Diagram 5. How an external script with defer works

1. Browser starts loading HTML
2. Browser sees <script src="file.js" defer>
3. Browser continues loading HTML
4. HTML finishes loading
5. JavaScript runs

19. Where to place the <script> tag

When using defer, the <script> tag can be placed:

In this case, there is no important difference.

20. Why external scripts are usually better

External scripts are usually preferred because they make code:

This is the standard way in real projects.

21. Live reload in VSCode

If you use VSCode with the Live Server extension, the webpage reloads automatically when you save changes in your script file.

This is very useful during development because you can quickly see the result of your changes.

22. What is strict mode?

Strict mode is a special JavaScript mode that makes the language safer and more modern.

It helps prevent certain mistakes and blocks some old or unsafe behaviors.

To enable strict mode, write this at the beginning of the script:

'use strict';

Example:

'use strict';

console.log("Strict mode is on");

Why strict mode is useful

It helps you:

It is a good habit to use strict mode in your projects.

Diagram 6. Why strict mode is useful

1. You enable strict mode
2. JavaScript checks code more carefully
3. Some bad or old patterns are not allowed
4. Your code becomes safer and easier to maintain

23. Outputting data

When writing code, a developer often needs to check:

A common tool for this is the browser console.

The console is in the browser's developer tools.

You usually open it on the Console tab.

Shortcuts

24. console.log()

The console.log() method prints data to the developer console.

Syntax:

console.log(value);

Whatever is inside the parentheses will be shown in the console.

Example 1

console.log("JavaScript is awesome!");

Output in console:

JavaScript is awesome!

Example 2

console.log(10);

Output in console:

10

Example 3

let name = "Nikita";
console.log(name);

Output:

Nikita

25. Why console.log() is important

console.log() is one of the first tools every JavaScript developer learns.

It is useful for:

Example:

let a = 5;
let b = 10;
let result = a + b;

console.log(result);

Output:

15

This helps you see whether your code works as expected.

Diagram 7. How console.log() helps

1. Write code
2. Print a value with console.log()
3. Open the console
4. Check the result
5. Fix the code if needed

26. Why semicolons matter in your tasks

In modern JavaScript, semicolons are sometimes omitted in real projects, depending on code style.

But in your learning tasks and auto-check systems, you should always use semicolons.

Example:

console.log("Hello");

This is safer for beginner tasks because some auto-checkers expect semicolons and may fail without them.

So for learning platforms and auto-check tasks:

always end the line with ;

27. What are tests in an auto-checker?

In coding platforms, under a task you may see a section called Tests.

These are automatic checks.

They verify whether your solution matches the task requirements.

After you click Check, the system runs tests automatically.

What tests do

They check things like:

So if a task says there are tests, that is normal. It is just the system checking your answer.

Diagram 8. How the auto-checker works

1. You write code
2. You click "Check"
3. The system runs tests
4. The system compares your code with the task rules
5. You get the result

28. Full example: reading code correctly

Let's look again at this statement:

a = b * 2;

Suppose:

b = 10;

Then JavaScript works like this:

  1. find the current value of b
  2. replace b with 10
  3. calculate 10 * 2
  4. get 20
  5. save 20 into a

Final result:

a = 20;

This is a very important beginner idea:

29. Mini summary of key terms

Programming

Writing instructions for a computer.

Syntax

Rules for writing code correctly.

Code

Instructions written for the computer.

Source code

The text of a program written by a developer.

Compiler / Interpreter

Programs that process source code so the computer can execute it.

Algorithm

A sequence of steps used to solve a problem.

JavaScript

A programming language used in browsers and many other areas.

Statement

A complete instruction in code.

Variable

A named place for storing data.

Operator

A symbol that performs an action.

Expression

A part of code that produces a value.

Literal

A value written directly in code.

<script>

HTML tag used to connect JavaScript.

defer

Runs the script after HTML is loaded.

Strict mode

A safer and stricter execution mode in JavaScript.

console.log()

Prints data to the browser console.

Tests

Automatic checks used by learning platforms or auto-checkers.

30. Simple beginner examples

Example 1: numeric literal

console.log(100);

Example 2: string literal

console.log("Hello, JavaScript");

Example 3: variable and expression

let b = 10;
let a = b * 2;
console.log(a);

Result:

20

Example 4: strict mode

'use strict';

console.log("My script is running");

Example 5: external script in HTML

<script src="main.js" defer></script>

31. Important beginner ideas to remember

  1. JavaScript is one of the main languages for web development.
  2. Syntax matters a lot. Even a small mistake can break the code.
  3. A statement is a full instruction.
  4. An expression is a smaller part inside the statement.
  5. A literal is a value written directly in code.
  6. Variables store values.
  7. console.log() is very useful for learning and debugging.
  8. External scripts are usually better than embedded scripts.
  9. defer helps load scripts at the right time.
  10. Strict mode is a good habit.

32. Final conclusion

JavaScript terminology may look difficult at first, but the ideas are actually very logical.

When you learn JavaScript, try to read code like a system of small steps:

This way of thinking will help you not only in JavaScript, but in full stack development in general.

The more examples you read and write, the easier these terms will become.

33. Short revision block

Programming = writing instructions for a computer
Syntax = rules of the language
Code = instructions
Source code = program text written by a developer
Algorithm = step-by-step solution
Statement = full instruction
Expression = part of instruction that gives a value
Variable = named storage
Literal = direct value in code
Operator = symbol that performs an action
console.log() = print to console
<script> = connect JavaScript to HTML
defer = run script after HTML is loaded
'use strict'; = safer JavaScript mode
Tests = automatic checks in tasks
⬅ Back